home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / Controls.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  5.7 KB  |  202 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Sunday, January 6, 1991 at 10:25 PM
  3.     Controls.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc. 1985-1990
  7.         All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Controls;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingControls}
  21. {$SETC UsingControls := 1}
  22.  
  23. {$I+}
  24. {$SETC ControlsIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickdraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$SETC UsingIncludes := ControlsIncludes}
  30.  
  31. CONST
  32. pushButProc = 0;
  33. checkBoxProc = 1;
  34. radioButProc = 2;
  35. useWFont = 8;
  36. scrollBarProc = 16;
  37. inButton = 10;
  38. inCheckBox = 11;
  39. inUpButton = 20;
  40. inDownButton = 21;
  41. inPageUp = 22;
  42. inPageDown = 23;
  43. inThumb = 129;
  44.  
  45. popupMenuProc = 1008;               { 63 * 16 }
  46. popupFixedWidth = $0001;            { popup menu CDEF variation codes }
  47. popupUseAddResMenu = $0004;
  48. popupUseWFont = $0008;
  49. popupTitleBold = $00000100;         {    Popup Title characteristics }
  50. popupTitleItalic = $00000200;
  51. popupTitleUnderline = $00000400;
  52. popupTitleOutline = $00000800;
  53. popupTitleShadow = $00001000;
  54. popupTitleCondense = $00002000;
  55. popupTitleExtend = $00004000;
  56. popupTitleNoStyle = $00008000;
  57. popupTitleLeftJust = $00000000;
  58. popupTitleCenterJust = $00000001;
  59. popupTitleRightJust = $000000FF;
  60.  
  61. {
  62. axis constraints for DragGrayRgn call}
  63. noConstraint = 0;
  64. hAxisOnly = 1;
  65. vAxisOnly = 2;
  66.  
  67. {
  68. control messages}
  69. drawCntl = 0;
  70. testCntl = 1;
  71. calcCRgns = 2;
  72. initCntl = 3;
  73. dispCntl = 4;
  74. posCntl = 5;
  75. thumbCntl = 6;
  76. dragCntl = 7;
  77. autoTrack = 8;
  78. calcCntlRgn = 10;
  79. calcThumbRgn = 11;
  80.  
  81. cFrameColor = 0;
  82. cBodyColor = 1;
  83. cTextColor = 2;
  84. cThumbColor = 3;
  85. popupMenuCDEFproc = popupMenuProc;  { synonym for compatibility }
  86.  
  87. TYPE
  88. ControlPtr = ^ControlRecord;
  89. ControlHandle = ^ControlPtr;
  90. ControlRecord = PACKED RECORD
  91.     nextControl: ControlHandle;
  92.     contrlOwner: WindowPtr;
  93.     contrlRect: Rect;
  94.     contrlVis: Byte;
  95.     contrlHilite: Byte;
  96.     contrlValue: INTEGER;
  97.     contrlMin: INTEGER;
  98.     contrlMax: INTEGER;
  99.     contrlDefProc: Handle;
  100.     contrlData: Handle;
  101.     contrlAction: ProcPtr;
  102.     contrlRfCon: LONGINT;
  103.     contrlTitle: Str255;
  104.     END;
  105.  
  106. CCTabPtr = ^CtlCTab;
  107. CCTabHandle = ^CCTabPtr;
  108. CtlCTab = RECORD
  109.     ccSeed: LONGINT;                {reserved}
  110.     ccRider: INTEGER;               {see what you have done - reserved}
  111.     ctSize: INTEGER;                {usually 3 for controls}
  112.     ctTable: ARRAY [0..3] OF ColorSpec;
  113.     END;
  114.  
  115. AuxCtlPtr = ^AuxCtlRec;
  116. AuxCtlHandle = ^AuxCtlPtr;
  117. AuxCtlRec = RECORD
  118.     acNext: AuxCtlHandle;           {handle to next AuxCtlRec}
  119.     acOwner: ControlHandle;         {handle for aux record's control}
  120.     acCTable: CCTabHandle;          {color table for this control}
  121.     acFlags: INTEGER;               {misc flag byte}
  122.     acReserved: LONGINT;            {reserved for use by Apple}
  123.     acRefCon: LONGINT;              {for use by application}
  124.     END;
  125.  
  126.  
  127. FUNCTION NewControl(theWindow: WindowPtr;boundsRect: Rect;title: Str255;
  128.     visible: BOOLEAN;value: INTEGER;min: INTEGER;max: INTEGER;procID: INTEGER;
  129.     refCon: LONGINT): ControlHandle;
  130.     INLINE $A954;
  131. PROCEDURE SetCTitle(theControl: ControlHandle;title: Str255);
  132.     INLINE $A95F;
  133. PROCEDURE GetCTitle(theControl: ControlHandle;VAR title: Str255);
  134.     INLINE $A95E;
  135. FUNCTION GetNewControl(controlID: INTEGER;owner: WindowPtr): ControlHandle;
  136.     INLINE $A9BE;
  137. PROCEDURE DisposeControl(theControl: ControlHandle);
  138.     INLINE $A955;
  139. PROCEDURE KillControls(theWindow: WindowPtr);
  140.     INLINE $A956;
  141. PROCEDURE HideControl(theControl: ControlHandle);
  142.     INLINE $A958;
  143. PROCEDURE ShowControl(theControl: ControlHandle);
  144.     INLINE $A957;
  145. PROCEDURE DrawControls(theWindow: WindowPtr);
  146.     INLINE $A969;
  147. PROCEDURE Draw1Control(theControl: ControlHandle);
  148.     INLINE $A96D;
  149. PROCEDURE HiliteControl(theControl: ControlHandle;hiliteState: INTEGER);
  150.     INLINE $A95D;
  151. PROCEDURE UpdtControl(theWindow: WindowPtr;updateRgn: RgnHandle);
  152.     INLINE $A953;
  153. PROCEDURE UpdateControls(theWindow: WindowPtr;updateRgn: RgnHandle);
  154.     INLINE $A953;
  155. PROCEDURE MoveControl(theControl: ControlHandle;h: INTEGER;v: INTEGER);
  156.     INLINE $A959;
  157. PROCEDURE SizeControl(theControl: ControlHandle;w: INTEGER;h: INTEGER);
  158.     INLINE $A95C;
  159. PROCEDURE SetCtlValue(theControl: ControlHandle;theValue: INTEGER);
  160.     INLINE $A963;
  161. FUNCTION GetCtlValue(theControl: ControlHandle): INTEGER;
  162.     INLINE $A960;
  163. PROCEDURE SetCtlMin(theControl: ControlHandle;minValue: INTEGER);
  164.     INLINE $A964;
  165. FUNCTION GetCtlMin(theControl: ControlHandle): INTEGER;
  166.     INLINE $A961;
  167. PROCEDURE SetCtlMax(theControl: ControlHandle;maxValue: INTEGER);
  168.     INLINE $A965;
  169. FUNCTION GetCtlMax(theControl: ControlHandle): INTEGER;
  170.     INLINE $A962;
  171. PROCEDURE SetCRefCon(theControl: ControlHandle;data: LONGINT);
  172.     INLINE $A95B;
  173. FUNCTION GetCRefCon(theControl: ControlHandle): LONGINT;
  174.     INLINE $A95A;
  175. PROCEDURE SetCtlAction(theControl: ControlHandle;actionProc: ProcPtr);
  176.     INLINE $A96B;
  177. FUNCTION GetCtlAction(theControl: ControlHandle): ProcPtr;
  178.     INLINE $A96A;
  179. PROCEDURE DragControl(theControl: ControlHandle;startPt: Point;limitRect: Rect;
  180.     slopRect: Rect;axis: INTEGER);
  181.     INLINE $A967;
  182. FUNCTION TestControl(theControl: ControlHandle;thePt: Point): INTEGER;
  183.     INLINE $A966;
  184. FUNCTION TrackControl(theControl: ControlHandle;thePoint: Point;actionProc: ProcPtr): INTEGER;
  185.     INLINE $A968;
  186. FUNCTION FindControl(thePoint: Point;theWindow: WindowPtr;VAR theControl: ControlHandle): INTEGER;
  187.     INLINE $A96C;
  188. PROCEDURE SetCtlColor(theControl: ControlHandle;newColorTable: CCTabHandle);
  189.     INLINE $AA43;
  190. FUNCTION GetAuxCtl(theControl: ControlHandle;VAR acHndl: AuxCtlHandle): BOOLEAN;
  191.     INLINE $AA44;
  192. FUNCTION GetCVariant(theControl: ControlHandle): INTEGER;
  193.     INLINE $A809;
  194.  
  195.  
  196. {$ENDC}    { UsingControls }
  197.  
  198. {$IFC NOT UsingIncludes}
  199.     END.
  200. {$ENDC}
  201.  
  202.